Skip to content

Fix issues #207, #217, #227, #250 - #261

Merged
jbbel merged 4 commits into
AMReX-Fluids:developmentfrom
jbbel:fix-issues-207-217-227-250
Oct 9, 2026
Merged

jbbel merged 4 commits into
AMReX-Fluids:developmentfrom
jbbel:fix-issues-207-217-227-250

Conversation

@jbbel

@jbbel jbbel commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #207,
fixes #217,
fixes #227,
fixes #250.

Issues addressed

#207: the LES eddy viscosity is kinematic (nu_t), but it is added to the dynamic viscosity mu. Both the Smagorinsky and Sigma models compute (C·Δ)²·|S| = ν_t, and getViscosity added that directly to IAMR's dynamic μ. So wherever ρ ≠ 1 the eddy viscosity was off by 1/ρ. calc_mut_LES now fills ρ with one ghost cell at the same time and multiplies both models by the face-averaged density, so μ_t = ρ·ν_t. The LES section of AlgorithmOptions.rst now says this. Any run with ns.do_LES=1 and ρ ≠ 1 will give different results, including Tutorials/HotSpot/inputs.3d.LES_hotspot.

#217: getViscTerms on level > 0 calls crse_ns.get_rho(time) at a fine-substep time. For Laplacian_SoverRho scalars (ns.do_cons_trac=1), get_rho only handles the coarse old/half/new times. Ratio 4 dereferences a null rho_qtime, and ratio 3 fails with "bad time". This combination now aborts with a clear message when the ref ratio to the coarser level is > 2. Ratio 2 is unchanged.

#227: unused Source/Utilities and NS_util.cpp vector helpers. Nothing called read_binary, read_csv, read_file, locate, VectorMax, VectorMin or VectorMaxAbs. This PR removes Source/Utilities/ and NS_util.cpp, drops them from Exec/Make.IAMR and Source/Make.package, and removes the includes that are no longer needed. NS_util.H stays for convertToDeviceVector, which NavierStokesBase.cpp uses.

#250: the Exec/run2d/test_grids decks abort at startup. This removes the 11 inputs_* decks and the 6 probin_* files, which nothing references. The fixed_grids_N and plt0000_N files are kept. The README now describes each grid configuration with the n_cell, prob_hi, max_level and ref_ratio it needs (plus max_grid_size for configuration 1), and explains how to use it through amr.regrid_file from an existing 2D inputs file.

Testing

🤖 Generated with Claude Code

jbbel and others added 4 commits October 8, 2026 17:35
Both the Smagorinsky and Sigma models compute (C*Delta)^2 * |S|, a
kinematic eddy viscosity nu_t, but getViscosity adds it directly to
IAMR's dynamic viscosity mu. For variable or non-unit density the
subgrid viscosity was therefore wrong by a factor 1/rho. Multiply by
the face-averaged density so mu_t = rho*nu_t, and document this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Rho on level>0 with ref_ratio > 2

On level > 0, getViscTerms divides the coarse data of a
Laplacian_SoverRho scalar by crse_ns.get_rho(time), where time is a
fine-level time. get_rho only supports the coarse old/half/new times,
which match a fine time only for ref ratio 2: ratio 4 dereferences a
null rho_qtime/rho_tqtime and ratio 3 fails with "bad time". Abort with
a clear message instead when the ref ratio exceeds 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r helpers

Nothing in Source/, Exec/ or Tutorials/ calls read_binary, read_csv,
read_file or locate (Source/Utilities), or VectorMax/VectorMin/
VectorMaxAbs (NS_util.cpp); they were only compiled, and the readers
had latent overruns and a declaration/definition mismatch under
USE_FLOAT. Remove Source/Utilities and NS_util.cpp, drop them from
Exec/Make.IAMR and Source/Make.package, and remove the now-unneeded
includes. NS_util.H is kept for convertToDeviceVector, which
NavierStokesBase.cpp uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ks, update README

The eleven inputs_* decks and six probin_* namelists in
Exec/run2d/test_grids predate the C++ problem setup: none sets
prob.probtype, the probin files are never read (AMREX_NO_PROBINIT),
and several also abort on RZ-with-viscosity or temp_cond_coef without
do_temp. Nothing references them. Remove them and keep the
fixed_grids_N and plt0000_N files, which are still valid. Rewrite the
README to describe each grid configuration with the domain, max_level,
ref_ratio (and max_grid_size) it needs, and how to use it from an
existing 2D inputs file via amr.regrid_file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jbbel
jbbel requested a review from asalmgren October 9, 2026 00:38
@jbbel
jbbel merged commit a7ecad0 into AMReX-Fluids:development Oct 9, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment